<template>
{{#if page.psSysPFPlugin}}
    {{> @macro/plugins/view/view-use.hbs appPlugin=page.psSysPFPlugin}}
{{else}}
    {{#if page.psViewLayoutPanel.useDefaultLayout}}
    {{#if page.mainMenuAlign}}
    {{#eq page.mainMenuAlign 'LEFT'}}<AppIndexViewLayoutLeft{{/eq~}}
    {{#eq page.mainMenuAlign 'TOP'}}<AppIndexViewLayoutTop{{/eq~}}
    {{#eq page.mainMenuAlign 'CENTER'}}<AppIndexViewLayoutCenter{{/eq~}}
    {{#eq page.mainMenuAlign 'TABEXP_LEFT'}}<AppIndexViewLayoutTabExp{{/eq~}}
    {{#eq page.mainMenuAlign 'TREEEXP'}}<AppIndexViewLayoutTabExp{{/eq~}}
    {{#eq page.mainMenuAlign 'TABEXP_TOP'}}<AppIndexViewLayoutTabExp{{/eq~}}
    {{#eq page.mainMenuAlign 'TABEXP_RIGHT'}}<AppIndexViewLayoutTabExp{{/eq~}}
    {{#eq page.mainMenuAlign 'TABEXP_BOTTOM'}}<AppIndexViewLayoutTabExp{{/eq~}}
    {{else}}
    <AppIndexViewLayoutLeft
    {{~/if}} :mainMenuAlign="model.mainMenuAlign" :class="classNames">
        <template #appHeaderLeft>
            {{#if page.showCaptionBar}}
            <div class="app-header__left__logo">
                <AppIconText :imgPath="model.appIconPath"></AppIconText>
                {{> @macro/view/view-caption.hbs}}
            </div>
            {{/if}}
        </template>
        <template #appHeaderRight>
            <template v-if="store.showLang">
                <AppLang></AppLang>
            </template>
            <template v-if="store.showTheme">
                <AppTheme></AppTheme>
            </template>
            <template v-if="store.showOrg">
                <span>组织选择</span>
            </template>
            <AppUser></AppUser>
            <template v-if="store.showMsgPopover">
                <AppMessagePopover></AppMessagePopover>
            </template>
        </template>
{{#neq page.mainMenuAlign 'NONE'}}
{{#page.ctrls}}
    {{#eq controlType 'APPMENU'}}
        <template #default>
          {{> @macro/widgets/menu-detail/menu.hbs ctrl=ctrl}}
        </template>
    {{/eq}}
{{/page.ctrls}}
{{/neq}}
        <template #tabPageExp>
            <TabPageExp></TabPageExp>
        </template>
        <template #navPos>
            <AppNavPos></AppNavPos>
        </template>
    {{#if page.mainMenuAlign}}
    {{#eq page.mainMenuAlign 'LEFT'}}</AppIndexViewLayoutLeft>{{/eq}}{{#eq page.mainMenuAlign 'TOP'}}</AppIndexViewLayoutTop>{{/eq}}{{#eq page.mainMenuAlign 'CENTER'}}</AppIndexViewLayoutCenter>{{/eq}}{{#eq page.mainMenuAlign 'TABEXP_LEFT'}}</AppIndexViewLayoutTabExp>{{/eq}}{{#eq page.mainMenuAlign 'TREEEXP'}}</AppIndexViewLayoutTabExp>{{/eq}}{{#eq page.mainMenuAlign 'TABEXP_TOP'}}</AppIndexViewLayoutTabExp>{{/eq}}{{#eq page.mainMenuAlign 'TABEXP_RIGHT'}}</AppIndexViewLayoutTabExp>{{/eq}}{{#eq page.mainMenuAlign 'TABEXP_BOTTOM'}}</AppIndexViewLayoutTabExp>{{/eq}}
    {{else}}
    </AppIndexViewLayoutLeft>
    {{/if}}
    {{else}}
    <div :class="classNames">
        {{#if page.psViewLayoutPanel.rootPSPanelItems}}
        {{#each page.psViewLayoutPanel.rootPSPanelItems as | panelItem |}}
        {{> @macro/widgets/panel-detail/include-panel.hbs type=panelItem.itemType item=panelItem isMultiData=false panel=page.psViewLayoutPanel page=page}}
        {{/each}}
        {{/if}}
    </div>
    {{/if}}
{{/if}}
</template>
<script setup lang="ts">
// 基于template/src/views/\{{appModules}}/\{{pages@APPINDEXVIEW}}/\{{spinalCase page.codeName}}.vue.hbs生成
{{#if page.psViewLayoutPanel.useDefaultLayout}}
{{#if page.mainMenuAlign}}
{{~#eq page.mainMenuAlign 'LEFT'}}import { AppIndexViewLayoutLeft } from "@components/layout/index-view-layout";{{/eq}}
{{~#eq page.mainMenuAlign 'TOP'}}import { AppIndexViewLayoutTop } from "@components/layout/index-view-layout";{{/eq}}
{{~#eq page.mainMenuAlign 'CENTER'}}import { AppIndexViewLayoutCenter } from "@components/layout/index-view-layout";{{/eq}}
{{~#eq page.mainMenuAlign 'TABEXP_LEFT'}}import { AppIndexViewLayoutTabExp } from "@components/layout/index-view-layout";{{/eq}}
{{~#eq page.mainMenuAlign 'TREEEXP'}}import { AppIndexViewLayoutTabExp } from "@components/layout/index-view-layout";{{/eq}}
{{~#eq page.mainMenuAlign 'TABEXP_TOP'}}import { AppIndexViewLayoutTabExp } from "@components/layout/index-view-layout";{{/eq}}
{{~#eq page.mainMenuAlign 'TABEXP_RIGHT'}}import { AppIndexViewLayoutTabExp } from "@components/layout/index-view-layout";{{/eq}}
{{~#eq page.mainMenuAlign 'TABEXP_BOTTOM'}}import { AppIndexViewLayoutTabExp } from "@components/layout/index-view-layout";{{/eq}}
{{else}}
import { AppIndexViewLayoutLeft } from "@components/layout/index-view-layout";
{{/if}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{else}}
import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';
{{#if page.psViewLayoutPanel.viewProxyMode}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.psViewLayoutPanel.psControls}}
{{else}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{/if}}
{{/if}}
import { model } from "./{{spinalCase page.codeName}}-model";
import { 
    getIndexViewClassNames, 
    handleCtrlInit, 
    handleCtrlAction, 
    handleCtrlDestroy, 
    useNavParamsBind, 
    useEventBind,
{{#unless page.psViewLayoutPanel.useDefaultLayout}}
    handleComponentAction,
    {{#if page.psViewLayoutPanel.psControls}}
    {{#each page.psViewLayoutPanel.psControls as | ctrl |}}
    {{#eq ctrl.controlType 'TOOLBAR'}}
    handleToolbarItemClick,
    {{/eq}}
    {{/each}}
    {{/if}}
{{/unless}}
} from '@/hooks/use-view';
import { IIndexViewAbility, IIndexViewController, IIndexViewControllerParams, IIndexViewStore, IndexViewActionType, IndexViewController, IParam, ILoadingHelper, IContext, IEvent } from "@/core";

{{> @macro/view/view-props.hbs props="appIconPath?: string"}}

{{> @macro/common/emit.hbs name="view" actionType="IndexViewActionType" ability="IIndexViewAbility"}}

const classNames = computed(() => {
  return getIndexViewClassNames(model, props);
});

const params: IIndexViewControllerParams<IndexViewActionType, IIndexViewAbility> = {
    name: props.name,
    model, 
    evt,
    isLoadDefault: props.isLoadDefault,
    openType:props.openType, 
    pLoadingHelper:props.pLoadingHelper, 
    handler: (data: IIndexViewStore) => { return reactive(data); } 
};

{{> @macro/common/controller.hbs name="view" IController="IIndexViewController" store="IIndexViewStore" ability="IIndexViewAbility" controller="IndexViewController"}}
</script>